package com.itheima.test4;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        //键盘录入

        //1.遇到制表符、回车停止接收
        //nextInt()接受整数
        //next()接受字符串
        //nextDouble()接受小数
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个整数");
        int num1 = sc.nextInt();
        System.out.println(num1);
        System.out.println("请输入第二个整数");
        int num2 = sc.nextInt();
        System.out.println(num2);

        //2.可以接受空格、制表符，遇到回车才停止接收
        //nextLine()接受字符串
        Scanner sc1 = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str1 = sc1.nextLine();
        System.out.println(str1);
        System.out.println("请输入第二个字符串");
        String str2 = sc1.nextLine();
        System.out.println(str2);



    }
}
